const mongoose = require("mongoose")

// 创建当前数据库某个集合的约束对象
const adminSchema = mongoose.Schema({
  // 用户名
  adminName: {
    type: String,
    unique: true,
    required: true
  },
  // 密码
  password: {
    type: String,
    required: true
  },
  // 注册时间
  regTime: {
    type: String,
    required: true
  },
  // 登录时间
  loginTime: {
    type: String,
    required: true,
    default: "----"
  },
})

// 根据约束对象创建集合
const adminModel = mongoose.model("adminList", adminSchema)

module.exports = adminModel